import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
//如果使用React,则使用 PersistGate 包裹根组建
import { PersistGate } from 'redux-persist/lib/integration/react';
import {store,persistor} from './redux/store';
import {Provider} from 'react-redux';
ReactDOM.render(
	<Provider store={store}>
		{/* // loading 和 persistor是2个必需属性 */}
    {/* // loading={null} || loading={<LoadingView />} LoadingView为React组件 */}
    {/* // 最好将loading={null}，写成loading={<LoadingView />} 报错，原因暂不明 */}
    <PersistGate loading={null} persistor={persistor}>
			<App/>
    </PersistGate>
	</Provider>,
  document.getElementById('root')
);
reportWebVitals();